﻿// <copyright file="FourByteSensorTelegram.cs" company="Hallvard Korsgaard">
//  Microsoft Public License (Ms-PL). See license details here: http://enoceannet.codeplex.com/license
// </copyright>
// <author>Hallvard Korsgaard</author> 

namespace EnOcean.Radio.Sensor
{
  using System;

  /// <summary>
  /// Base class for 4 byte telegrams (ORG = 0x07).
  /// </summary>
  [Serializable]
  public abstract class FourByteSensorTelegram : SensorTelegram
  {
    /// <summary>
    /// Creates the byte format of the message.
    /// </summary>
    /// <param name="message">A byte array of length 14 to hold the message contents.</param>
    protected internal override void CreateMessage(byte[] message)
    {
      base.CreateMessage(message);
      message[3] = (byte)Org.FourByteSensor; // Org
      // Status
      message[12] = this.RepeatCounter;
    }
  }
}
